﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace ConsoleApp1.DbCustom.Models
{
    [Index(nameof(Name), Name = "AK_KEY_2_Blog_PersonCategory", IsUnique = true)]
    [Index(nameof(UserId), Name = "Index_1")]
    public partial class Blog_PersonCategory
    {
        public Blog_PersonCategory()
        {
            Blog_PersonCategory_Map = new HashSet<Blog_PersonCategory_Map>();
        }

        [Key]
        [StringLength(36)]
        [Unicode(false)]
        public string Id { get; set; } = null!;
        [StringLength(36)]
        [Unicode(false)]
        public string UserId { get; set; } = null!;
        [StringLength(50)]
        public string Name { get; set; } = null!;
        [StringLength(200)]
        public string? Description { get; set; }
        public bool? IsVisible { get; set; }
        [StringLength(36)]
        [Unicode(false)]
        public string? CreatedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? CreatedTime { get; set; }
        [StringLength(36)]
        [Unicode(false)]
        public string? LastModifiedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? LastModifiedTime { get; set; }

        [ForeignKey(nameof(UserId))]
        [InverseProperty(nameof(Sys_User.Blog_PersonCategory))]
        public virtual Sys_User User { get; set; } = null!;
        [InverseProperty("PersonCategory")]
        public virtual ICollection<Blog_PersonCategory_Map> Blog_PersonCategory_Map { get; set; }
    }
}
